#include "stdafx.h"
#include "ckConnectionFactory.h"
#include "ckConnection.h"
#include "ckConnectionAccess.h"
#include "ckConnectionMySQL.h"

namespace ck
{
	ConnectionFactory::ConnectionFactory()
	{
	}


	ConnectionFactory::~ConnectionFactory()
	{
	}

	ConnectionFactory*	ConnectionFactory::GetInstance()
	{
		static ConnectionFactory g_connFactory;
		return &g_connFactory;
	}

	Connection* ConnectionFactory::CreateConnection(ckDbType type)
	{
		Connection* pConnection = NULL;
		switch (type)
		{
		case ckDbAccess:
			pConnection = new ConnectionAccess();
			break;
		case ckDbMySQL:
			pConnection = new ConnectionMySQL();
			break;
		case ckDbOracle:
			break;
		default:
			break;
		}
		return pConnection;
	}
}

